home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / AIncludes / HardwareEqu.a < prev    next >
Encoding:
Text File  |  1992-01-29  |  42.2 KB  |  1,083 lines  |  [TEXT/MPS ]

  1. ; Version: 1.5
  2. ; Created: Tuesday, September 19, 1989
  3. ;
  4. ; File: HardwareEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1984-1991
  8. ; All Rights Reserved
  9. ;
  10. ;--------------------------------------------------------------------
  11. ;
  12. ; The following information was formerly in "private" files that were
  13. ; not released to the general developer community.
  14. ;
  15. ; The information in this file is not needed for normal application
  16. ; development. These equates and macros were necessary for development
  17. ; of the Macintosh ToolBox and Operating System, and are likely to be
  18. ; dependent on their current implementation. Use of any information
  19. ; in this file is likely to cause your software to fail on future
  20. ; versions of Macintosh system software or hardware.
  21. ;
  22. ; Apple Developer Support will not support any use of the following
  23. ; information.
  24. ;
  25. ; In order to prevent any "accidental" use of this information, it has
  26. ; been disabled using the conditional-assembly variable, HWNonPortable,
  27. ; defined below. If you change this to a non-zero value, you're on your
  28. ; own. Since this gives hardware specific equates, we must also define
  29. ; which type of Mac we are assembling for. Define the following variable:
  30. ;
  31. ;        onMac        128K, 512K, 512Ke, or Mac Plus
  32. ;        onMacPP        Mac SE
  33. ;        onNuMac        Mac II,IIx,IIcx,SE/30
  34. ;        onHafMac    Mac IIci
  35. ;        onHcMac        Portable
  36. ;        onMac16        universal 68000 ROM
  37. ;        onMac32        universal 68020/30/40/? ROM
  38. ;
  39. ; Hardware Equates -- This file defines the low-level equates for the
  40. ; Macintosh hardware interface.
  41. ;--------------------------------------------------------------------
  42.     IF &TYPE('__IncludingHardwareEqu__') = 'UNDEFINED' THEN
  43. __IncludingHardwareEqu__    SET    1
  44.  
  45.  
  46.                   IF          (&TYPE('onMac') = 'UNDEFINED') THEN 
  47. onMac             EQU         0
  48.                   ENDIF
  49.  
  50.                   IF          (&TYPE('onMacPP') = 'UNDEFINED') THEN
  51. onMacPP           EQU         0
  52.                   ENDIF
  53.  
  54.                   IF          (&TYPE('onNuMac') = 'UNDEFINED') THEN
  55. onNuMac           EQU         0
  56.                   ENDIF
  57.  
  58.                   IF          (&TYPE('onHafMac') = 'UNDEFINED') THEN
  59. onHafMac           EQU         0
  60.                   ENDIF
  61.  
  62.                   IF          (&TYPE('onHcMac') = 'UNDEFINED') THEN
  63. onHcMac           EQU         0
  64.                   ENDIF
  65.  
  66.                   IF          (&TYPE('onMac16') = 'UNDEFINED') THEN
  67. onMac16           EQU         0
  68.                   ENDIF
  69.  
  70.                   IF          (&TYPE('onMac32') = 'UNDEFINED') THEN
  71. onMac32           EQU         0
  72.                   ENDIF
  73.  
  74. onAnything        EQU         onMac|onMacPP|onHcMac|onHafMac|onNuMac
  75.  
  76.  
  77. ; *** If HWNonPortable is defined to be non-zero, Then a machine type must be specified!
  78. ; *** If a machine is specified, HWNonPortable must be non-zero, specified or not.
  79.                   IF          (&TYPE('HWNonPortable') = 'UNDEFINED') THEN
  80. HWNonPortable     EQU         onAnything
  81.                   ENDIF
  82.  
  83.                   IF          HWNonPortable THEN
  84.  
  85. ;----------
  86. ; Hardware configuration bits.
  87. ;----------
  88.  
  89. ;the following goes with hwCfgFlags 
  90.  
  91. hwCbSCSI          EQU         15                        ; SCSI port present
  92. hwCbClock         EQU         14                        ; New clock chip present
  93. hwCbExPRAM        EQU         13                        ; Extra Parameter Ram valid.
  94. hwCbFPU           EQU         12                        ; FPU chip present.
  95. hwCbMMU           EQU         11                        ; Some kind of MMU present (see MMUType for what kind).
  96. hwCbADB           EQU         10                        ; Apple Desktop Bus present.
  97. hwCbAUX            EQU            9                        ; Running A/UX                    <2.8>
  98. hwCbPwrMgr        EQU            8                        ; Power Manager present            <2.8>
  99. hwCmSCSI          EQU         (1 << hwCbSCSI)
  100. hwCmClock         EQU         (1 << hwCbClock)
  101. hwCmExPRAM        EQU         (1 << hwCbExPRAM)
  102. hwCmFPU           EQU         (1 << hwCbFPU)
  103. hwCmMMU           EQU         (1 << hwCbMMU)
  104. hwCmADB           EQU         (1 << hwCbADB)
  105. hwCmAUX            EQU            (1 << hwCbAUX)
  106. hwCmPwrMgr        EQU            (1 << hwCbPwrMgr)
  107.  
  108.  
  109.  
  110. ;----------
  111. ; 6522 VIA offsets
  112. ;----------
  113.  
  114. vBufB             EQU         0                         ; BUFFER B
  115. vBufAH            EQU         $200                      ; buffer a (with handshake) [ Dont use! ]
  116. vDIRB             EQU         $400                      ; DIRECTION B
  117. vDIRA             EQU         $600                      ; DIRECTION A
  118. vT1C              EQU         $800                      ; TIMER 1 COUNTER (L.O.)
  119. vT1CH             EQU         $A00                      ; timer 1 counter (high order)
  120. vT1L              EQU         $C00                      ; TIMER 1 LATCH (L.O.)
  121. vT1LH             EQU         $E00                      ; timer 1 latch (high order)
  122. vT2C              EQU         $1000                     ; TIMER 2 LATCH (L.O.)
  123. vT2CH             EQU         $1200                     ; timer 2 counter (high order)
  124. vSR               EQU         $1400                     ; SHIFT REGISTER
  125. vACR              EQU         $1600                     ; AUX. CONTROL REG.
  126. vPCR              EQU         $1800                     ; PERIPH. CONTROL REG.
  127. vIFR              EQU         $1A00                     ; INT. FLAG REG.
  128. vIER              EQU         $1C00                     ; INT. ENABLE REG.
  129. vBufA             EQU         $1E00                     ; BUFFER A
  130.  
  131. ; === VIA IFR/IER bits ===
  132. ifCA2             EQU         0                         ; CA2 interrupt
  133. ifCA1             EQU         1                         ; CA1 interrupt
  134. ifSR              EQU         2                         ; SR shift register done
  135. ifCB2             EQU         3                         ; CB2 interrupt
  136. ifCB1             EQU         4                         ; CB1 interrupt
  137. ifT2              EQU         5                         ; T2 timer2 interrupt
  138. ifT1              EQU         6                         ; T1 timer1 interrupt
  139. ifIRQ             EQU         7                         ; any interrupt
  140.  
  141.  
  142. ;----------
  143. ; IWM Offsets
  144. ;----------
  145.  
  146. ph0L              EQU         0                         ; disk address offsets from base
  147. ph0H              EQU         $200
  148. ph1L              EQU         $400
  149. ph1H              EQU         $600
  150. ph2L              EQU         $800
  151. ph2H              EQU         $A00
  152. ph3L              EQU         $C00
  153. ph3H              EQU         $E00
  154. mtrOff            EQU         $1000
  155. mtrOn             EQU         $1200
  156. intDrive          EQU         $1400                     ; enable internal drive address
  157. extDrive          EQU         $1600                     ; enable external drive address
  158. q6L               EQU         $1800
  159. q6H               EQU         $1A00
  160. q7L               EQU         $1C00
  161. q7H               EQU         $1E00
  162.  
  163. ;_______________________________________;            <2.5>
  164. ;
  165. ;  SWIM offsets
  166. ;_______________________________________;
  167.  
  168. wData             EQU         $0000                     ;Write a data byte
  169. wMark             EQU         $0200                     ;Write a mark byte
  170. wCRC              EQU         $0400                     ;Write a 2-byte CRC (1 access does both)
  171. wIWMConfig        EQU         wCRC                      ;Set IWM configuration
  172. wParams           EQU         $0600                     ;Set the 16 parameter registers
  173. wPhase            EQU         $0800                     ;Set phase lines states and directions
  174. wSetup            EQU         $0A00                     ;Set the current configuration
  175. wZeroes           EQU         $0C00                     ;Mode reg: 1's clr bits, 0's=don't care
  176. wOnes             EQU         $0E00                     ;Mode reg: 1's set bits, 0's=don't care
  177. rData             EQU         $1000                     ;Read a data byte
  178. rCorrection       EQU         rData                     ;Read the correction factor
  179. rMark             EQU         $1200                     ;Read a mark byte
  180. rError            EQU         $1400                     ;Error register
  181. rParams           EQU         $1600                     ;Parameters (16 bytes deep at this addr)
  182. rPhase            EQU         $1800                     ;Phase lines states and directions
  183. rSetup            EQU         $1A00                     ;Read the current configuration
  184. rStatus           EQU         $1C00                     ;Status (returns current mode reg value)
  185. rHandshake        EQU         $1E00                     ;Handshake register
  186.  
  187.  
  188. ;----------
  189. ; 8530 SCC Offsets
  190. ;----------
  191.  
  192. aData             EQU         6                         ; offset for A channel data
  193. aCtl              EQU         2                         ; offset for A channel control
  194. bData             EQU         4                         ; offset for B channel data
  195. bCtl              EQU         0                         ; offset for B channel control
  196. sccData           EQU         4                         ; general offset for data from control
  197. rxBF              EQU         0                         ; SCC receive buffer full
  198. txBE              EQU         2                         ; SCC transmit buffer empty
  199. RxCA            EQU            0                        ; Receive Character Available            <5>
  200.  
  201. ;----------
  202. ; SCC Clock Rates, Baud Rate Constants
  203. ;----------
  204.  
  205. macClock          EQU         36707                     ; in Hz * 100
  206. hcMacClock        EQU         36720                     ; SCC clock rates
  207. midMacClock       EQU         39168
  208. nuMacClock        EQU         36864
  209. lisaAClock        EQU         40000                     ; port A clock
  210. lisaBCLock        EQU         36864                     ; port B clock
  211. macConst          EQU         114709                    ; in Hz/32
  212. hcMacConst        EQU         114750
  213. midMacConst       EQU         122400
  214. nuMacConst        EQU         115200
  215. lisaAConst        EQU         125000
  216. lisaBConst        EQU         115200
  217.  
  218.  
  219. ;----------
  220. ; 53C80 SCSI Register Defs, Offsets
  221. ;----------
  222.  
  223. sCDR              EQU         $00                       ; Current SCSI Read Data
  224. sODR              EQU         $00                       ; Output data register
  225. sICR              EQU         $10                       ; Initiator Command Register - READ/WRITE
  226. iRST              EQU         $80                       ; *RST asserted
  227. iAIP              EQU         $40                       ; arbitration in progress (read)
  228. bAIP              EQU         6                         ; bit test for arbitration in progress
  229. aTMD              EQU         $40                       ; assert Test Mode (write)
  230. iLA               EQU         $20                       ; Lost arbitration (read)
  231. bLA               EQU         5                         ; bit test for Lost Arbitration
  232. aDIFF             EQU         $20                       ; assert Differential enable (write)
  233. iACK              EQU         $10                       ; *ACK is asserted
  234. iBSY              EQU         $08                       ; *BSY is asserted
  235. iSEL              EQU         $04                       ; *SEL is asserted
  236. iATN              EQU         $02                       ; *ATN is asserted
  237. iDB               EQU         $01                       ; Data bus is asserted
  238. sMR               EQU         $20                       ; Mode Register - READ/WRITE
  239. iBDMA             EQU         $80                       ; Block Mode DMA
  240. iTGT              EQU         $40                       ; Target Mode
  241. iPTY              EQU         $20                       ; Enable Parity Checking
  242. iIPTY             EQU         $10                       ; Enable Parity interrupt
  243. iIEOP             EQU         $08                       ; Enable EOP interrupt
  244. iMBSY             EQU         $04                       ; Monitor BSY
  245. iDMA              EQU         $02                       ; DMA Mode
  246. iARB              EQU         $01                       ; Arbitration
  247. sTCR              EQU         $30                       ; Target Command Register - READ/WRITE
  248. iREQ              EQU         $08                       ; Assert *REQ
  249. iMSG              EQU         $04                       ; Assert *MSG
  250. iCD               EQU         $02                       ; Assert C/*D
  251. iIO               EQU         $01                       ; Assert I/*O
  252. sCSR              EQU         $40                       ; Current SCSI Bus Status (READ)
  253. aRST              EQU         $80                       ; *RST
  254. aBSY              EQU         $40                       ; *BSY
  255. bBSY              EQU         6                         ; bit test for *BSY
  256. aREQ              EQU         $20                       ; *REQ
  257. bREQ              EQU         5                         ; bit test for *REQ
  258. aMSG              EQU         $10                       ; *MSG
  259. bMSG              EQU         4                         ; bit test for *MSG
  260. aCD               EQU         $08                       ; C/*D
  261. bCD               EQU         3                         ; bit test for C/*D
  262. aIO               EQU         $04                       ; I/*O
  263. bIO               EQU         2                         ; bit test for I/*O
  264. aSEL              EQU         $02                       ; *SEL
  265. bSEL              EQU         1                         ; bit test for *SEL
  266. aDBP              EQU         $01                       ; *DBP
  267. sSER              EQU         $40                       ; Select Enable Register (WRITE)
  268. sBSR              EQU         $50                       ; Bus & Status Register (READ)
  269. iEDMA             EQU         $80                       ; End of DMA
  270. bEDMA             EQU         7                         ; bit test for end of DMA
  271. iDMAR             EQU         $40                       ; DMA Request
  272. bDMAR             EQU         6                         ; bit test for DMA Req
  273. iPERR             EQU         $20                       ; Parity Error
  274. iIREQ             EQU         $10                       ; Interrupt Request
  275. bIREQ             EQU         4                         ; bit test for interrupt
  276. iPM               EQU         $08                       ; Phase Match
  277. bPM               EQU         3                         ; bit test for Phase Match
  278. iBERR             EQU         $04                       ; Bus Error
  279. ATN               EQU         $02                       ; *ATN
  280. ACK               EQU         $01                       ; *ACK
  281. bACK              EQU         0                         ; bit test for ACK
  282. sDMAtx            EQU         $50                       ; DMA Transmit Start (WRITE)
  283. sIDR              EQU         $60                       ; Data input register (READ)
  284. sTDMArx           EQU         $60                       ; Start Target DMA receive (WRITE)
  285. sRESET            EQU         $70                       ; Reset Parity/Interrupt (READ)
  286. sIDMArx           EQU         $70                       ; Start Initiator DMA receive (WRITE)
  287.  
  288.  
  289.  
  290. ;----------
  291. ; VIA2 register definitions
  292. ;----------
  293.  
  294. ; === VIA2 BUFFER A ===
  295. v2IRQ1            EQU         0                         ; slot 1 interrupt
  296. v2IRQ2            EQU         1                         ; slot 2 interrupt
  297. v2IRQ3            EQU         2                         ; slot 3 interrupt
  298. v2IRQ4            EQU         3                         ; slot 4 interrupt
  299. v2IRQ5            EQU         4                         ; slot 5 interrupt
  300. v2IRQ6            EQU         5                         ; slot 6 interrupt
  301. v2RAM0            EQU         6                         ; RAM size bit 0
  302. v2RAM1            EQU         7                         ; RAM size bit 1
  303.  
  304. ; === VIA2 BUFFER B ===
  305. v2CDis            EQU         0                         ; cache disable (when 1)    <3.3>
  306. v2BusLk           EQU         1                         ; Bus lockout
  307. v2PowerOff        EQU         2                         ; soft power off signal (when 0)
  308. vFC3              EQU         3                         ; PMMU FC3 indicator
  309. v2TM1A            EQU         4                         ; bit for NUBus
  310. v2TM0A            EQU         5                         ; and another
  311. v2SndExt          EQU         6                         ; 1 = internal speaker, 0 = ext. audio
  312. v2VBL             EQU         7                         ; pseudo VBL signal
  313.  
  314.  
  315.                   IF          onMac THEN
  316. ;=======================================;
  317. ;  Macintosh Plus Hardware Information    ;
  318. ;=======================================;
  319.  
  320. hwCfgBits         EQU         hwCmSCSI++hwCmClock
  321. machine           EQU         0
  322. rom85Bits         EQU         $7F                       ; New ROMs, No Power Off.
  323.  
  324. ; === Interrupt Masks ===
  325. hiIntMask         EQU         $0300                    ; programmer switch only
  326. sccIntMask        EQU         $0200                     ; SCC interrupt Level        <1.5>
  327. sccEnblMask       EQU         $F9FF                     ; mask to enable SCC interrupts
  328. viaIntMask        EQU         $0100                     ; mask for VIA (and VBL) interrupts
  329. loIntMask         EQU         $0100
  330.  
  331. ; === VIA1 BUFFER A ===
  332. vSound            EQU         $7                        ; sound volume bits (0..2)
  333. vSndPg2           EQU         3                         ; select sound page 2 if 0
  334. vOverlay          EQU         4                         ; overlay bit (overlay when 1)
  335. vHeadSel          EQU         5                         ; head select line for Sony
  336. vPage2            EQU         6                         ; select video page 2 if 0
  337. vSCCWrReq         EQU         7                         ; SCC write/request line
  338.  
  339. vAOut             EQU         (vSound)|\                ; sound volume bits are outputs
  340.                             (1<<vSndPg2)|\            ; sound page 2 select is an output
  341.                             (1<<vOverlay)|\            ; overlay bit is an output
  342.                             (1<<vHeadSel)|\            ; head select line is an output
  343.                             (1<<vPage2)|\            ; video page 2 select is an output
  344.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  345.  
  346. vAInit             EQU         (1)|\                    ; sound volume level initially 1
  347.                             (1<<vSndPg2)|\            ; main sound buffer selected
  348.                             (0<<vOverlay)|\            ; overlay is turned off
  349.                             (1<<vHeadSel)|\            ; head select line is an output
  350.                             (1<<vPage2)|\            ; main screen buffer selected
  351.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  352.  
  353. vBufD             EQU         vBufA                     ; disk head select is buffer A
  354.  
  355.  
  356. ; === VIA1 BUFFER B ===
  357. vRTCData          EQU         0                         ; real time clock data
  358. vRTCClk           EQU         1                         ; real time clock clock pulses
  359. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  360. vSW               EQU         3                         ; mouse switch (0 when down)
  361. vX2               EQU         4                         ; mouse X level
  362. vY2               EQU         5                         ; mouse Y level
  363. vH4               EQU         6                         ; horizontal sync
  364. vSndEnb           EQU         7                         ; /sound enable (reset when 1)
  365.  
  366. vBOut             EQU         (1<<vRTCData)|\            ; real time clock data initially an output
  367.                             (1<<vRTCClk)|\            ; real time clock clock is an output
  368.                             (1<<vRTCEnb)|\            ; clock enable is an output
  369.                             (0<<vSW)|\                ; mouse switch is an input
  370.                             (0<<vX2)|\                ; mouse X level is an input
  371.                             (0<<vY2)|\                ; mouse Y level is an input
  372.                             (0<<vH4)|\                ; horizontal sync is an input
  373.                             (1<<vSndEnb)            ; sound enable is an output
  374.  
  375. vBInit             EQU         (1<<vRTCData)|\            ; real time clock data is one
  376.                             (1<<vRTCClk)|\            ; real time clock clock is high
  377.                             (1<<vRTCEnb)|\            ; clock initially disabled
  378.                             (0<<vSW)|\                ; mouse switch is an input
  379.                             (0<<vX2)|\                ; mouse X level is an input
  380.                             (0<<vY2)|\                ; mouse Y level is an input
  381.                             (0<<vH4)|\                ; horizontal sync is an input
  382.                             (1<<vSndEnb)            ; sound is disabled
  383.  
  384. vBufM            EQU         vBufB                      ; mouse state is buffer B
  385.  
  386.  
  387. ; === Hardware Base Addresses ===
  388.  
  389. PhaseRead         EQU         $F00000                   ; Phase read address
  390.  
  391. VBase             EQU         $EFE1FE                   ; VIA base address
  392. AVBufA            EQU         VBase+vBufA             ; VIA buffer A
  393. AVBufB            EQU         VBase+vBufB              ; VIA buffer B
  394. AVBufM            EQU         VBase+vBufM              ; VIA buffer with mouse button bit
  395.  
  396. SCCRBase          EQU         $9FFFF8                   ; SCC base read address
  397. SCCWBase          EQU         $BFFFF9                   ; SCC base write address
  398. sccWrite          EQU         SCCWBase-SCCRBase        ; general offset for write from read
  399.  
  400. SCSIRd            EQU         $580000                   ; base addr SCSI interface - READ
  401. SCSIWr            EQU         $580001                   ; base addr SCSI interface - WRITE
  402. wrOffs            EQU         SCSIWr-SCSIRd            ; write addrs are +1 to the read base
  403.  
  404. SoundLow          EQU         $3FFD00                   ; sound buffer start address
  405. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  406.  
  407. PWMBuffer         EQU         $3FFD01                   ; PWM bytes are low bytes
  408. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  409.  
  410. ; === Video Parameters ===
  411.  
  412. ScreenLow         EQU         $3FA700                   ; top of screen screen address
  413. scrn2MemTop       EQU         $5900                     ; ScreenBase to Memtop
  414.  
  415. ; === System Software Information ===
  416.  
  417. bufWorldSize      EQU         scrn2MemTop               ; total size of the BufPtr world
  418. seRegs            EQU         $3FFC80                   ; Sys Error Regs w/o Overlay
  419.  
  420.                   ELSEIF      onMacPP THEN
  421. ;=======================================;
  422. ;    Macintosh SE Hardware Information    ;
  423. ;=======================================;
  424.  
  425. hwCfgBits         EQU         hwCmSCSI++hwCmClock++hwCmADB
  426. machine           EQU         2
  427. rom85Bits         EQU         $7F                       ; New ROMs, No Power Off.
  428.  
  429. ; === Interrupt Masks ===
  430. hiIntMask         EQU         $0300                    ; programmer switch only
  431. sccIntMask        EQU         $0200                     ; SCC interrupt Level        <1.5>
  432. sccEnblMask       EQU         $F9FF                     ; mask to enable SCC interrupts
  433. viaIntMask        EQU         $0100                     ; mask for VIA (and VBL) interrupts
  434. loIntMask         EQU         $0100
  435.  
  436. ; === VIA1 BUFFER A ===
  437. vSound            EQU         $7                        ; sound volume bits (0..2)
  438. vSync             EQU         3                         ; Synchronous modem
  439. vDriveSel         EQU         4                         ; int drive select (lower drive when 1)
  440. vHeadSel          EQU         5                         ; head select line for Sony
  441. vPage2            EQU         6                         ; select video page 2 if 0
  442. vSCCWrReq         EQU         7                         ; SCC write/request line
  443.  
  444. vAOut             EQU         (vSound)|\                ; sound volume bits are outputs
  445.                             (1<<vSync)|\            ; Synchronous modem is an output
  446.                             (1<<vDriveSel)|\        ; int drive select is an output
  447.                             (1<<vHeadSel)|\            ; head select line is an output
  448.                             (1<<vPage2)|\            ; video page 2 select is an output
  449.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  450.  
  451. vAInit             EQU         (1)|\                    ; sound volume level initially 1
  452.                             (1<<vSync)|\            ; Synchronous modem disabled (active low)
  453.                             (0<<vDriveSel)|\        ; upper floppy drive selected
  454.                             (1<<vHeadSel)|\            ; head select line is an output
  455.                             (1<<vPage2)|\            ; main screen buffer selected
  456.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  457.  
  458. vBufD             EQU         vBufA                     ; disk head select is buffer A
  459.  
  460.  
  461. ; === VIA1 BUFFER B ===
  462. vRTCData          EQU         0                         ; real time clock data
  463. vRTCClk           EQU         1                         ; real time clock clock pulses
  464. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  465. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  466. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  467. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  468. vSCSIMask         EQU         6                         ; SCSI IRQ mask
  469. vH4               EQU         vSCSIMask                ; SCSI IRQ mask (was horiz. sync)
  470. vSndEnb           EQU         7                         ; /sound enable (reset when 1)
  471.  
  472. vBOut             EQU         (1<<vRTCData)|\            ; real time clock data initially an output
  473.                             (1<<vRTCClk)|\            ; real time clock clock is an output
  474.                             (1<<vRTCEnb)|\            ; clock enable is an output
  475.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  476.                             (1<<vFDesk1)|\            ; FDB state bit 0 is an output
  477.                             (1<<vFDesk2)|\            ; FDB state bit 1 is an output
  478.                             (1<<vSCSIMask)|\        ; SCSI IRQ mask is an output
  479.                             (1<<vSndEnb)            ; sound enable is an output
  480.  
  481. vBInit             EQU         (1<<vRTCData)|\            ; real time clock data is one
  482.                             (1<<vRTCClk)|\            ; real time clock clock is high
  483.                             (1<<vRTCEnb)|\            ; clock initially disabled
  484.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  485.                             (1<<vFDesk1)|\            ; FDB state bit 0 is initially state 3
  486.                             (1<<vFDesk2)|\            ; FDB state bit 1 is initially state 3
  487.                             (1<<vSCSIMask)|\        ; SCSI IRQ mask is initially masked
  488.                             (1<<vSndEnb)            ; sound is disabled
  489.  
  490.  
  491. ; === Hardware Base Addresses ===
  492.  
  493. VBase             EQU         $EFE1FE                   ; VIA base address
  494. AVBufA            EQU         VBase+vBufA             ; VIA buffer A
  495. AVBufB            EQU         VBase+vBufB              ; VIA buffer B
  496.  
  497. SCCRBase          EQU         $9FFFF8                   ; SCC base read address
  498. SCCWBase          EQU         $BFFFF9                   ; SCC base write address
  499. sccWrite          EQU         SCCWBase-SCCRBase        ; general offset for write from read
  500.  
  501. SCSIRd            EQU         $5FF000                   ; base addr SCSI interface - READ
  502. SCSIWr            EQU         $5FF001                   ; base addr SCSI interface - WRITE
  503. MacSCSIBase       EQU         $5FF000                   ; base addr SCSI READ interface
  504. MacSCSIDMA        EQU         $5FF200                   ; base addr SCSI DMA
  505. MacSCSIHsk        EQU         $5FF200                   ; base addr SCSI handshake
  506. wrOffs            EQU         SCSIWr-SCSIRd            ; write addrs are +1 to the read base
  507.  
  508. SoundLow          EQU         $3FFD00                   ; sound buffer start address
  509. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  510.  
  511. PWMBuffer         EQU         $3FFD01                   ; PWM bytes are low bytes
  512. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  513.  
  514. ; === Video Parameters ===
  515.  
  516. ScreenLow         EQU         $3FA700                   ; top of screen screen address
  517. scrn2MemTop       EQU         $5900                     ; ScreenBase to Memtop
  518.  
  519. ; === System Software Information ===
  520.  
  521. bufWorldSize      EQU         scrn2MemTop               ; total size of the BufPtr world
  522. seRegs            EQU         $3FFC80                   ; Sys Error Regs w/o Overlay
  523.  
  524.                   ELSEIF      onHcMac THEN
  525. ;===========================================;
  526. ;    Macintosh Portable Hardware Information    ;
  527. ;===========================================;
  528.  
  529. hwCfgBits         EQU         hwCmSCSI++hwCmClock++hwCmADB++hwCbPwrMgr                ; <2.8>
  530. machine           EQU         3
  531. rom85Bits         EQU         $7F                       ; New ROMs, No Power Off.
  532.  
  533. ; === Interrupt Masks ===
  534. hiIntMask         EQU         $0300                    ; programmer switch only
  535. sccIntMask        EQU         $0200                     ; SCC interrupt Level        <1.5>
  536. sccEnblMask       EQU         $F9FF                     ; mask to enable SCC interrupts
  537. viaIntMask        EQU         $0100                     ; mask for VIA (and VBL) interrupts
  538. loIntMask         EQU         $0100
  539.  
  540. ; === VIA1 BUFFER A ===
  541.                                                     ; 68000 <-> PowerMgr data bus
  542. vAIn              EQU         $00                       ; VBufA output bits (all inputs)
  543. vAOut             EQU         $FF                       ; VBufA output bits (all outputs)
  544. vAInit            EQU         $00                       ; VBufA initial values
  545.  
  546.  
  547. ; === VIA1 BUFFER B ===
  548. vPMreq            EQU         0                         ; Power manager handshake request
  549. vPMack            EQU         1                         ; Power manager handshake acknowledge
  550. vTestJ            EQU         2                         ; Test jumper
  551. vSync             EQU         3                         ; Synchronous modem
  552. vDriveSel         EQU         4                         ; int drive select (lower drive when 1)
  553. vHeadSel          EQU         5                         ; head select line for Sony
  554. vStereo           EQU         6                         ; Stereo sound enable
  555. vSCCWrReq         EQU         7                         ; SCC write/request line        (input)
  556. vSndEnb           EQU         7                         ; /sound enable (reset when 1)    (output)
  557.  
  558. vBOut             EQU         (1<<vPMreq)|\            ; Power mgr handshake request is an output
  559.                             (0<<vPMack)|\            ; Power mgr handshake acknowledge is an input
  560.                             (0<<vTestJ)|\            ; Test jumper is an input
  561.                             (1<<vSync)|\            ; Synchronous modem is an output
  562.                             (1<<vDriveSel)|\        ; int drive select is an output
  563.                             (1<<vHeadSel)|\            ; head select line is an output
  564.                             (0<<vStereo)|\            ; Stereo sound detect is an input
  565.                             (1<<vSndEnb)            ; sound enable is an output
  566.  
  567. vBInit             EQU         (1<<vPMreq)|\            ; Power mgr handshake not requesting
  568.                             (1<<vPMack)|\            ; Power mgr handshake acknowledge is an input
  569.                             (1<<vTestJ)|\            ; Test jumper is an input
  570.                             (1<<vSync)|\            ; Synchronous modem disabled (active low)
  571.                             (1<<vDriveSel)|\        ; lower floppy drive selected
  572.                             (0<<vHeadSel)|\            ; head select line is an output
  573.                             (1<<vStereo)|\            ; Stereo sound detect is an input
  574.                             (1<<vSndEnb)            ; sound is disabled
  575.  
  576. vBufD             EQU         vBufB                     ; disk head select is buffer B
  577.  
  578.  
  579. ; === Hardware Base Addresses ===
  580.  
  581. VBase             EQU         $F70000                   ; VIA base address
  582. AVBufA            EQU         VBase+vBufA             ; VIA buffer A
  583. AVBufB            EQU         VBase+vBufB              ; VIA buffer B
  584.  
  585. SCCRBase          EQU         $FD0000                   ; SCC base read address
  586. SCCWBase          EQU         $FD8000                   ; SCC base write address
  587. sccWrite          EQU         SCCWBase-SCCRBase        ; general offset for write from read
  588.  
  589. SCSIRd            EQU         $F90000                   ; base address of SCSI interface - READ
  590. SCSIWr            EQU         $F90001                   ; base address of SCSI interface - WRITE
  591. MacSCSIBase       EQU         $F90000                   ; base address of SCSI READ interface
  592. MacSCSIDMA        EQU         $F90200                   ; base address of SCSI DMA
  593. MacSCSIHsk        EQU         $F90200                   ; base address of SCSI handshake
  594. wrOffs            EQU         SCSIWr-SCSIRd            ; write addrs are +1 to the read base
  595.  
  596. SndBase           EQU         $FB0000                   ; sound chip's base address
  597.  
  598. MapperBase        EQU         $FC0000                   ; Mapper RAM base address
  599.  
  600. RAMconfigBase     EQU         $FE0200                   ; Internal/external RAM control register
  601. RAMconfigInit    EQU            $0006                    ; Init test register                        <v2.6>
  602.  
  603. ; === Video Parameters ===
  604.  
  605. ScreenLow         EQU         $FA8000                   ; top of screen screen address
  606. hcVideoSize       EQU         $8000                     ; 32k of video memory
  607. HcVideoStart      EQU         ScreenLow
  608. HcVideoEnd        EQU         HcVideoStart+hcVideoSize
  609. NTSCMaxX        EQU            512                        ; NTSC output is narrow
  610. NTSCOffset        EQU            8                        ;  and centered
  611. LCDmode            EQU            0                        ; Normal built in screen
  612. Mac2mode        EQU            1                        ; Custom screen for Mac2
  613. NTSCmode        EQU            2                        ; NTSC output
  614.  
  615. ; === System Software Information ===
  616. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  617. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  618. bufWorldSize      EQU         snd2MemTop                ; total size of the BufPtr world
  619. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  620.  
  621.  
  622.                   ELSEIF      onMac16 THEN
  623. ;===================================================;
  624. ;    Universal 16 bit Macintosh Hardware Information    ;
  625. ;===================================================;
  626.  
  627.  
  628. ; === Interrupt Masks ===
  629. hiIntMask         EQU         $0300                    ; programmer switch only
  630. sccIntMask        EQU         $0200                     ; SCC interrupt Level        <1.5>
  631. sccEnblMask       EQU         $F9FF                     ; mask to enable SCC interrupts
  632. viaIntMask        EQU         $0100                     ; mask for VIA (and VBL) interrupts
  633. loIntMask         EQU         $0100
  634.  
  635. ; === VIA1 BUFFER A ===
  636. vSound            EQU         $7                        ; sound volume bits (0..2)
  637. vSndPg2           EQU         3                         ; select sound page 2 if 0
  638. ;vSync             EQU         3                         ; Synchronous modem
  639. vOverlay          EQU         4                         ; overlay bit (overlay when 1)
  640. ;vDriveSel         EQU         4                         ; int drive select (lower drive when 1)
  641. ;vHeadSel          EQU         5                         ; head select line for Sony
  642. vPage2            EQU         6                         ; select video page 2 if 0
  643. ;vSCCWrReq         EQU         7                         ; SCC write/request line
  644.  
  645.  
  646. ; === VIA1 BUFFER B ===
  647. vRTCData          EQU         0                         ; real time clock data
  648. vRTCClk           EQU         1                         ; real time clock clock pulses
  649. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  650. vSW               EQU         3                         ; mouse switch (0 when down)
  651. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  652. vX2               EQU         4                         ; mouse X level
  653. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  654. vY2               EQU         5                         ; mouse Y level
  655. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  656. vH4               EQU         6                         ; horizontal sync
  657. vSCSIMask         EQU         6                         ; SCSI IRQ mask
  658. vSndEnb           EQU         7                         ; /sound enable (reset when 1)
  659.  
  660. vPMreq            EQU         0                         ; Power manager handshake request
  661. vPMack            EQU         1                         ; Power manager handshake acknowledge
  662. vTestJ            EQU         2                         ; Test jumper
  663. ;vSync             EQU         3                         ; Synchronous modem
  664. ;vDriveSel         EQU         4                         ; int drive select (lower drive when 1)
  665. ;vHeadSel          EQU         5                         ; head select line for Sony
  666. vStereo           EQU         6                         ; Stereo sound enable
  667. ;vSCCWrReq         EQU         7                         ; SCC write/request line        (input)
  668.  
  669. ; === VIA1 BUFFER A/B ===
  670. vSync             EQU         3                         ; Synchronous modem                        <3.1>
  671. vDriveSel         EQU         4                         ; int drive select (lower drive when 1)    <3.1>
  672. vHeadSel          EQU         5                         ; head select line for Sony                <3.1>
  673. vSCCWrReq         EQU         7                         ; SCC write/request line                <3.1>
  674.  
  675. ; === Hardware Base Addresses ===
  676.  
  677. wrOffs            EQU         1                        ; write addrs are +1 to the read base
  678.  
  679. ; === System Software Information ===
  680. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  681.  
  682.                   ELSEIF      onMac32 THEN
  683. ;===================================================;
  684. ;    Universal 32 bit Macintosh Hardware Information    ;
  685. ;===================================================;
  686.  
  687. machine           EQU         6                        ; for patch file $067C                    <3.5>
  688.  
  689. ; === Interrupt Masks ===
  690. hiIntMask         EQU         $0700                    ; programmer switch only
  691. pwrOffEnbl        EQU         $2500                    ; mask to allow poweroff interrupts
  692. sccIntMask        EQU         $0400                    ; SCC interrupt level
  693. sccEnblMask       EQU         $FBFF                    ; mask to enable SCC interrupts
  694. slotIntMask       EQU         $0200                       ; slot's interrupt level    <v1.4><1.9>
  695. viaIntMask        EQU         $0100                    ; VIA1 interrupt level
  696. loIntMask         EQU         $0100
  697.  
  698. ; === VIA1 BUFFER A ===
  699. vSound            EQU         $7                        ; sound volume bits (0..2)    (output)
  700. vTestJ            EQU         0                         ; Burn In Test jumper        (input)
  701. vCpuId0            EQU            1                        ; CPU Identification bit 0    (input)
  702. vCpuId1            EQU            2                        ; CPU Identification bit 1    (input)
  703. vSync             EQU         3                         ; Synchronous modem
  704. vOverlay          EQU         4                         ; overlay bit (overlay when 1)
  705. vCpuId2            EQU            4                        ; CPU Identification bit 2
  706. vHeadSel          EQU         5                         ; head select line for Sony
  707. vRev8Bd           EQU         6                         ; =0 for rev 8 board
  708. vCpuId3            EQU            6                        ; CPU Identification bit 3
  709. vSCCWrReq         EQU         7                         ; SCC write/request line
  710.  
  711. ; === VIA1 BUFFER B ===
  712. vRTCData          EQU         0                         ; real time clock data
  713. v0reserved        EQU            0                        ; reserved bit in Erickson                <6>
  714. vRTCClk           EQU         1                         ; real time clock clock pulses
  715. v1reserved        EQU            1                        ; reserved bit in Erickson                <6>
  716. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  717. v2reserved        EQU            2                        ; reserved bit in Erickson                <6>
  718. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  719. xcvrsesbit        EQU            3                        ; Egret transceiver session bit            <6>
  720. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  721. viafullbit        EQU            4                        ; Egret via full bit                    <6>
  722. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  723. syssesbit        EQU            5                        ; Egret system session bit                <6>
  724. vPGCEnb            EQU            6                        ; Parity Generator/Checker enable (0 for enable)
  725. v6reserved        EQU            6                        ; reserved bit in Erickson                <6>
  726. vPGCErr            EQU            7                        ; Parity Generator/Checker error    (input)
  727. v7reserved        EQU            7                        ; reserved bit in Erickson                <6>
  728. vSndEnb           EQU         7                         ; /sound enable (reset when 1)        (output)
  729.  
  730.  
  731. ; === Hardware Base Addresses ===
  732.  
  733. WrOffs            EQU            0                        ; SCSI write addrs are same as read base
  734.  
  735. MskIOP1            EQU            1                        ; IOP 1 (SWIM) is level 1 interrupt
  736. MskVIA1            EQU            1                        ; VIA 1 is level 1
  737. MskADB            EQU            1                        ; ADB is level 1
  738. Msk60Hz            EQU            1                        ; 60 Hz is level 1
  739. MskSCSI            EQU            2                        ; SCSI is level 2
  740. MskSound        EQU            2                        ; sound is level 2                        <4.5>
  741. MskSlots        EQU            2                        ; slots are level 2 interrupts
  742. MskRTC            EQU            3                        ; RTC is level 3
  743. MskIOP0            EQU            4                        ; IOP 0 (& SCC chip) is level 4
  744. MskPwrOff        EQU            6                        ; Poweroff button is level 6
  745. MskNMI            EQU            7                        ; NMI switch is level 7
  746.  
  747. ; === System Software Information ===
  748. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  749. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  750. bufWorldSize      EQU         snd2MemTop                ; total size of the BufPtr world
  751. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  752.  
  753.  
  754.                   ELSEIF      onHafMac THEN
  755. ;===================================;
  756. ;    Mac IIci Hardware Information    ;
  757. ;===================================;
  758.  
  759. machine           EQU         6
  760.  
  761. ; === Interrupt Masks ===
  762. hiIntMask         EQU         $0700                     ; programmer switch only
  763. pwrOffEnbl        EQU         $2500                     ; mask to allow poweroff interrupts
  764. sccIntMask        EQU         $0400                     ; SCC interrupt level
  765. sccEnblMask       EQU         $FBFF                     ; mask to enable SCC interrupts
  766. via2IntMask       EQU         $0200                     ; VIA2 interrupt level        <v1.4><1.9>
  767. slotIntMask       EQU         via2IntMask               ; slot's interrupt level    <v1.4><1.9>
  768. viaIntMask        EQU         $0100                     ; VIA1 interrupt level
  769. loIntMask         EQU         $0100
  770.  
  771. ; === VIA1 BUFFER A ===
  772. vSound            EQU         $7                        ; sound volume bits (0..2)    (output)
  773. vTestJ            EQU         0                         ; Burn In Test jumper        (input)
  774. vCpuId0            EQU            1                        ; CPU Identification bit 0    (input)
  775. vCpuId1            EQU            2                        ; CPU Identification bit 1    (input)
  776. vSync             EQU         3                         ; Synchronous modem
  777. vCpuId2            EQU            4                        ; CPU Identification bit 2
  778. vHeadSel          EQU         5                         ; head select line for Sony
  779. vCpuId3            EQU            6                        ; CPU Identification bit 3
  780. vSCCWrReq         EQU         7                         ; SCC write/request line
  781.  
  782. vAOut             EQU         (vSound)|\                ; sound volume bits are outputs
  783.                             (1<<vSync)|\            ; Synchronous modem is an output
  784.                             (0<<vCpuId2)|\            ; CPU Identification bit 2 is an input
  785.                             (1<<vHeadSel)|\            ; head select line is an output
  786.                             (0<<vCpuId3)|\            ; CPU Identification bit 3 is an input
  787.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  788.  
  789. vAInit             EQU         (1)|\                    ; sound volume level initially 1
  790.                             (0<<vSync)|\            ; Synchronous modem disabled (active high)
  791.                             (0<<vCpuId2)|\            ; CPU Identification bit 2 is an input
  792.                             (1<<vHeadSel)|\            ; head select line is an output
  793.                             (0<<vCpuId3)|\            ; CPU Identification bit 3 is an input
  794.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  795.  
  796. vBufD             EQU         vBufA                     ; disk head select is buffer A
  797.  
  798.  
  799. ; === VIA1 BUFFER B ===
  800. vRTCData          EQU         0                         ; real time clock data
  801. vRTCClk           EQU         1                         ; real time clock clock pulses
  802. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  803. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  804. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  805. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  806. vPGCEnb            EQU            6                        ; Parity Generator/Checker enable (0 for enable)
  807. vPGCErr            EQU            7                        ; Parity Generator/Checker error    (input)
  808. vSndEnb           EQU         7                         ; /sound enable (reset when 1)        (output)
  809.  
  810. vBOut             EQU         (1<<vRTCData)|\            ; real time clock data initially an output
  811.                             (1<<vRTCClk)|\            ; real time clock clock is an output
  812.                             (1<<vRTCEnb)|\            ; clock enable is an output
  813.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  814.                             (1<<vFDesk1)|\            ; FDB state bit 0 is an output
  815.                             (1<<vFDesk2)|\            ; FDB state bit 1 is an output
  816.                             (1<<vPGCEnb)|\            ; PGC enable is an output
  817.                             (1<<vSndEnb)            ; sound enable is an output
  818.  
  819. vBInit             EQU         (1<<vRTCData)|\            ; real time clock data is one
  820.                             (1<<vRTCClk)|\            ; real time clock clock is high
  821.                             (1<<vRTCEnb)|\            ; clock initially disabled
  822.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  823.                             (1<<vFDesk1)|\            ; FDB state bit 0 is initially state 3
  824.                             (1<<vFDesk2)|\            ; FDB state bit 1 is initially state 3
  825.                             (1<<vPGCEnb)|\            ; Parity Checking is initially disabled
  826.                             (1<<vSndEnb)            ; sound is disabled
  827.  
  828.  
  829. ; === RBV BUFFER B ===
  830. RvBInit            EQU            (1<<RvCDis)|\            ; cache disabled    <3.3>
  831.                             (1<<RvBusLk)|\            ; Bus unlocked
  832.                             (1<<RvPowerOff)|\        ; Power on
  833.                             (1<<RvCFlush)|\            ; don't flush cache
  834.                             (0<<RvTM1A)|\            ; NuBus timeout bits are inputs
  835.                             (0<<RvTM0A)|\            ; NuBus timeout bits are inputs
  836.                             (0<<RvSndExt)|\            ; sound/speaker mode is an input
  837.                             (1<<RvPGCTest)            ; generate correct parity
  838.  
  839.  
  840. ; === Hardware Base Addresses ===
  841.  
  842. VBase             EQU         $50F00000               ; VIA base address
  843. AVBufA            EQU         VBase+vBufA             ; VIA buffer A
  844. AVBufB            EQU         VBase+vBufB              ; VIA buffer B
  845.  
  846. SCCRBase          EQU         $50F04000               ; SCC base read address
  847. SCCWBase          EQU         $50F04000               ; SCC base write address
  848. sccWrite          EQU         SCCWBase-SCCRBase        ; general offset for write from read
  849.  
  850. NewSCSIBase       EQU         $50F10000                 ; rev8 base addr SCSI interface
  851. NewSCSIDMA        EQU         $50F12000                 ; rev8 base addr SCSI DMA (corrected)
  852. NewSCSIHsk        EQU         $50F06000                 ; rev8 base addr SCSI handshake
  853. MacSCSIBase       EQU         $50F10000                 ; base addr SCSI interface
  854. MacSCSIDMA        EQU         $50F12000                 ; base addr SCSI DMA
  855. MacSCSIHsk        EQU         $50F06000                 ; base addr SCSI handshake
  856. wrOffs            EQU         0                         ; write addrs are same as read base
  857.  
  858. SndBase            EQU         $50F14000                 ; sound chip's base address
  859.  
  860. ; === Video Parameters ===
  861.  
  862. RBVBase            EQU            $50F26000                ; RBV base address                <v1.4><1.4>
  863. vDACBase        EQU            $50F24000                ; base of clut
  864.  
  865. ; === System Software Information ===
  866. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  867. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  868. bufWorldSize      EQU         snd2MemTop                ; total size of the BufPtr world
  869. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  870.  
  871.                   ELSEIF      onNuMac THEN
  872. ;=======================================================;
  873. ;    Macintosh II, IIx, IIcx, SE30 Hardware Information    ;
  874. ;=======================================================;
  875.  
  876. hwCfgBits         EQU         hwCmSCSI++hwCmClock++hwCmFPU++hwCmMMU++hwCmADB
  877. machine           EQU         1
  878. rom85Bits         EQU         $3F                       ; New ROMs, Power Off ability.
  879.  
  880. ; === Interrupt Masks ===
  881. hiIntMask         EQU         $0700                     ; programmer switch only
  882. pwrOffEnbl        EQU         $2500                     ; mask to allow poweroff interrupts
  883. sccIntMask        EQU         $0400                     ; SCC interrupt level
  884. sccEnblMask       EQU         $FBFF                     ; mask to enable SCC interrupts
  885. via2IntMask       EQU         $0200                     ; VIA2 interrupt level        <v1.4><1.9>
  886. slotIntMask       EQU         via2IntMask               ; slot's interrupt level    <v1.4><1.9>
  887. viaIntMask        EQU         $0100                     ; VIA1 interrupt level
  888. loIntMask         EQU         $0100
  889.  
  890. ; === VIA1 BUFFER A ===
  891. vSound            EQU         $7                        ; sound volume bits (0..2)    (output)
  892. vSync             EQU         3                         ; Synchronous modem
  893. vOverlay          EQU         4                         ; overlay bit (overlay when 1)
  894. vHeadSel          EQU         5                         ; head select line for Sony
  895. vRev8Bd           EQU         6                         ; =0 for rev 8 board
  896. vSCCWrReq         EQU         7                         ; SCC write/request line
  897.  
  898. vAOut             EQU         (vSound)|\                ; sound volume bits are outputs
  899.                             (1<<vSync)|\            ; Synchronous modem is an output
  900.                             (1<<vOverlay)|\            ; overlay bit is an output
  901.                             (1<<vHeadSel)|\            ; head select line is an output
  902.                             (0<<vRev8Bd)|\            ; board ID is an input
  903.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  904.  
  905. vAInit             EQU         (1)|\                    ; sound volume level initially 1
  906.                             (0<<vSync)|\            ; Synchronous modem disabled (active high)
  907.                             (0<<vOverlay)|\            ; overlay is turned off
  908.                             (0<<vHeadSel)|\            ; head select line is an output
  909.                             (0<<vRev8Bd)|\            ; board ID is an input
  910.                             (0<<vSCCWrReq)            ; SCC write/request line is an input
  911.  
  912. vBufD             EQU         vBufA                     ; disk head select is buffer A
  913.  
  914.  
  915. ; === VIA1 BUFFER B ===
  916. vRTCData          EQU         0                         ; real time clock data
  917. vRTCClk           EQU         1                         ; real time clock clock pulses
  918. vRTCEnb           EQU         2                         ; clock enable (0 for enable)
  919. vFDBInt           EQU         3                         ; Front Desk bus interrupt
  920. vFDesk1           EQU         4                         ; Front Desk bus state bit 0
  921. vFDesk2           EQU         5                         ; Front Desk bus state bit 1
  922. ;                EQU            6                        ; unused
  923. vSndEnb           EQU         7                         ; /sound enable (reset when 1)        (output)
  924.  
  925. vBOut             EQU         (1<<vRTCData)|\            ; real time clock data initially an output
  926.                             (1<<vRTCClk)|\            ; real time clock clock is an output
  927.                             (1<<vRTCEnb)|\            ; clock enable is an output
  928.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  929.                             (1<<vFDesk1)|\            ; FDB state bit 0 is an output
  930.                             (1<<vFDesk2)|\            ; FDB state bit 1 is an output
  931.                             (1<<vSndEnb)            ; sound enable is an output
  932.  
  933. vBInit             EQU         (1<<vRTCData)|\            ; real time clock data is one
  934.                             (1<<vRTCClk)|\            ; real time clock clock is high
  935.                             (1<<vRTCEnb)|\            ; clock initially disabled
  936.                             (0<<vFDBInt)|\            ; Front Desk bus interrupt is an input
  937.                             (1<<vFDesk1)|\            ; FDB state bit 0 is initially state 3
  938.                             (1<<vFDesk2)|\            ; FDB state bit 1 is initially state 3
  939.                             (0<<vSndEnb)            ; sound is enabled
  940.  
  941.  
  942. ; === VIA2 BUFFER A ===
  943. v2AOut            EQU         (0<<v2IRQ1)|\             ; slot 1 interrupt is an input
  944.                   (0<<v2IRQ2)|\                         ; slot 2 interrupt is an input
  945.                   (0<<v2IRQ3)|\                         ; slot 3 interrupt is an input
  946.                   (0<<v2IRQ4)|\                         ; slot 4 interrupt is an input
  947.                   (0<<v2IRQ5)|\                         ; slot 5 interrupt is an input
  948.                   (0<<v2IRQ6)|\                         ; slot 6 interrupt is an input
  949.                   (1<<v2RAM0)|\                         ; ram size bit 0 is an output
  950.                   (1<<v2RAM1)                           ; ram size bit 1 is an output
  951.  
  952. v2AInit            EQU            (0<<v2IRQ1)|\            ; slot 1 interrupt is an input
  953.                             (0<<v2IRQ2)|\            ; slot 2 interrupt is an input
  954.                             (0<<v2IRQ3)|\            ; slot 3 interrupt is an input
  955.                             (0<<v2IRQ4)|\            ; slot 4 interrupt is an input
  956.                             (0<<v2IRQ5)|\            ; slot 5 interrupt is an input
  957.                             (0<<v2IRQ6)|\            ; slot 6 interrupt is an input
  958.                             (0<<v2RAM0)|\            ; or ram size bit 0 with 0
  959.                             (0<<v2RAM1)                ; or ram size bit 1 with 0
  960.  
  961.  
  962. ; === VIA2 BUFFER B ===
  963. v2BOut            EQU            (0<<v2CDis)|\            ; cache disabled    <3.3>
  964.                   (0<<v2BusLk)|\                        ; Bus unlocked
  965.                   (0<<v2PowerOff)|\                     ; Power on
  966.                   (0<<vFC3)|\                           ; don't flush cache
  967.                   (0<<v2TM1A)|\                         ; NuBus timeout bits are inputs
  968.                   (0<<v2TM0A)|\                         ; NuBus timeout bits are inputs
  969.                   (0<<v2SndExt)|\                       ; sound/speaker mode is an input
  970.                   (1<<v2VBL)                            ; 60Hz pseudo VBL output
  971.  
  972. v2BInit            EQU            (1<<v2CDis)|\            ; cache disabled (input when not in use)    <3.3>
  973.                             (0<<v2BusLk)|\            ; Bus unlocked    (input when not in use)
  974.                             (1<<v2PowerOff)|\        ; Power on    (input when not in use)
  975.                             (0<<vFC3)|\                ; don't flush cache    (input when not in use)
  976.                             (0<<v2TM1A)|\            ; NuBus timeout bits are inputs
  977.                             (0<<v2TM0A)|\            ; NuBus timeout bits are inputs
  978.                             (0<<v2SndExt)|\            ; sound/speaker mode is an input
  979.                             (0<<v2VBL)                ; 60Hz pseudo VBL output
  980.  
  981.  
  982. ; === Hardware Base Addresses ===
  983.  
  984. VBase             EQU         $50F00000                 ; VIA base address
  985. AVBufA            EQU         VBase+vBufA               ; VIA buffer A
  986. AVBufB            EQU         VBase+vBufB               ; VIA buffer B
  987.  
  988. VBase2            EQU         $50F02000                 ; VIA2 base address                <v1.4>
  989.  
  990. SCCRBase          EQU         $50F04000                 ; SCC base read address
  991. SCCWBase          EQU         $50F04000                 ; SCC base write address
  992. sccWrite          EQU         SCCWBase-SCCRBase         ; general offset for write from read
  993.  
  994. NewSCSIBase       EQU         $50F10000                 ; rev8 base addr SCSI interface
  995. NewSCSIDMA        EQU         $50F12000                 ; rev8 base addr SCSI DMA (corrected)
  996. NewSCSIHsk        EQU         $50F06000                 ; rev8 base addr SCSI handshake
  997. MacSCSIBase       EQU         $50F10000                 ; base addr SCSI interface
  998. MacSCSIDMA        EQU         $50F12000                 ; base addr SCSI DMA
  999. MacSCSIHsk        EQU         $50F06000                 ; base addr SCSI handshake
  1000. wrOffs            EQU         0                         ; write addrs are same as read base
  1001.  
  1002. SndBase           EQU         $50F14000                 ; sound chip's base address
  1003.  
  1004. ; === System Software Information ===
  1005. snd2MemTop        EQU         $300                      ; SoundLow to Memtop
  1006. pwm2MemTop        EQU         $2FF                      ; PWMBuffer to MemTop
  1007. bufWorldSize      EQU         snd2MemTop                ; total size of the BufPtr world
  1008. seRegs            EQU         $0C30                     ; offset to Sys Error Regs w/o Overlay
  1009.  
  1010.                   ENDIF
  1011.  
  1012.  
  1013. ;----------
  1014. ; Deep Shit Rectangle info
  1015. ;----------
  1016.  
  1017. dsRectTL          EQU         (64<<16)+32               ; top left = 64,32
  1018. dsRectBR          EQU         (190<<16)+480             ; bottom right = 190,480
  1019. dsRectHei         EQU         (dsRectBR**$FFFF0000)-(dsRectTL**$FFFF0000)>>16
  1020. dsRectLen         EQU         (dsRectBR**$FFFF)-(dsRectTL**$FFFF)
  1021.  
  1022.  
  1023.                   IF          onAnything THEN
  1024.  
  1025. ;----------
  1026. ; System Error, ROM Based Debugger Nub, MicroBug Equates
  1027. ;----------
  1028.  
  1029. seVars            EQU         seRegs                    ; start of system error data space (wrap city)
  1030. seVSize           EQU         128                       ; # of bytes in space
  1031. seD0              EQU         seVars                    ; loc of saved reg D0
  1032. seA0              EQU         seD0+32                   ; loc of saved reg A0
  1033. seA7              EQU         seA0+28                   ; loc of saved reg A7
  1034. sePC              EQU         seA7+4                    ; loc of saved PC
  1035. seSR              EQU         sePC+4                    ; loc of saved SR
  1036. seAccess          EQU         seSR+2                    ; PC address during bus/address error
  1037. seCmdSize         EQU         seAccess+4                ; # of bytes of parameters passed in _debugger call
  1038. se000BE           EQU         seCmdSize+2               ; 8 bytes of bus error info for 68000
  1039. seLastVar         EQU         se000BE+8                 ; last var in System Error data space
  1040.  
  1041.  
  1042. ;-----
  1043. ; ROM based debugger nub
  1044. ;-----
  1045.  
  1046. rdPort            EQU         seLastVar                 ; Number of port currently in use (0 => no link, 1 => A, 2 => B)
  1047. rdCode            EQU         rdPort+2                  ; Ptr to code download buffer.
  1048. rdAtrap           EQU         rdCode+4                  ; Saved Rom Atrap handler
  1049. rdLowTrap         EQU         rdAtrap+4                 ; low value for trap handling
  1050. rdHiTrap          EQU         rdLowTrap+2               ; high value for trap handling
  1051. rdResult          EQU         rdHiTrap+2                ; result of executing down-loaded code, etc. (16 bytes)
  1052. rdEnd             EQU         rdResult+16               ; end of vars
  1053.  
  1054.  
  1055. ;-----
  1056. ; Microbug
  1057. ;-----
  1058.  
  1059. ; NOTE: Keep mbDotAddr immediately before mBlocAddr
  1060.  
  1061. mbBufSize         EQU         34
  1062. mbBuffer          EQU         seLastVar                 ; buffer for input
  1063. mbSign            EQU         mbBuffer+mbBufSize        ; ST => negative sign during conversion
  1064. mbDotAddr         EQU         mbSign+2                  ; saved address
  1065. mBlocAddr         EQU         mbDotAddr+4               ; saved location
  1066.  
  1067. ;----------
  1068. ; Timing constants
  1069. ;----------
  1070.  
  1071. VIAClockHz        EQU            783360                    ; VIA clock rate is 783360 Hz.        <2.8>
  1072. nTicks            EQU         VIAClockHz/1000           ; VIA timer ticks per msec
  1073. oneSecTicks       EQU         60                        ; ticks, of course
  1074. TimeSCSIDB        EQU            $0B24                    ; DBRAs & SCSI access per millisecond <1.9>
  1075.  
  1076. ramChk            EQU         1024                      ; Amount of memory tested for stack.
  1077.  
  1078.                   ENDIF
  1079.  
  1080.                   ENDIF                                 ; {HWNonPortable}
  1081.  
  1082.  
  1083.     ENDIF    ; ...already included